/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Minhdz
 */
@Entity
@Table(name = "CategoriesSeminar", catalog = "prjSem4", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CategoriesSeminar.findAll", query = "SELECT c FROM CategoriesSeminar c"),
    @NamedQuery(name = "CategoriesSeminar.findBySeminarTypeID", query = "SELECT c FROM CategoriesSeminar c WHERE c.seminarTypeID = :seminarTypeID"),
    @NamedQuery(name = "CategoriesSeminar.findBySeminarType", query = "SELECT c FROM CategoriesSeminar c WHERE c.seminarType = :seminarType")})
public class CategoriesSeminar implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "SeminarTypeID")
    private Integer seminarTypeID;
    @Size(max = 100)
    @Column(name = "SeminarType")
    private String seminarType;
    @OneToMany(mappedBy = "seminarTypeID")
    private Collection<Seminars> seminarsCollection;

    public CategoriesSeminar() {
    }

    public CategoriesSeminar(Integer seminarTypeID) {
        this.seminarTypeID = seminarTypeID;
    }

    public Integer getSeminarTypeID() {
        return seminarTypeID;
    }

    public void setSeminarTypeID(Integer seminarTypeID) {
        this.seminarTypeID = seminarTypeID;
    }

    public String getSeminarType() {
        return seminarType;
    }

    public void setSeminarType(String seminarType) {
        this.seminarType = seminarType;
    }

    @XmlTransient
    public Collection<Seminars> getSeminarsCollection() {
        return seminarsCollection;
    }

    public void setSeminarsCollection(Collection<Seminars> seminarsCollection) {
        this.seminarsCollection = seminarsCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (seminarTypeID != null ? seminarTypeID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CategoriesSeminar)) {
            return false;
        }
        CategoriesSeminar other = (CategoriesSeminar) object;
        if ((this.seminarTypeID == null && other.seminarTypeID != null) || (this.seminarTypeID != null && !this.seminarTypeID.equals(other.seminarTypeID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.CategoriesSeminar[ seminarTypeID=" + seminarTypeID + " ]";
    }
    
}
